/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package xml;

import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.UnsupportedEncodingException;

/**
 *
 * @author Administrador
 */
public class CrearXML {

    public void guardarDocumentoXML(String texto, String ruta) throws FileNotFoundException, IOException {

        try {

            OutputStream fout = new FileOutputStream(ruta);
            OutputStream bout = new BufferedOutputStream(fout);

            OutputStreamWriter out = new OutputStreamWriter(bout);

            out.write(texto);

            out.flush();

            out.close();

        } catch (UnsupportedEncodingException e) {

            System.out.println("NOOOO");
        }
    }
}
